package com.zz.ecommerce.status;

import com.zz.ecommerce.common.bean.TReceiptsI;
import com.zz.ecommerce.common.constants.TableConstants;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

/**
 * <一句话功能描述>
 * <功能详细描述>
 *
 * @author STEVEN
 * @date 2015/12/29,13:27
 */
@Controller
@RequestMapping("/status")
public class StatusController {

    @Autowired
    private TReceiptsCDao receiptsCDao;

    @Autowired
    private TReceiptsIDao receiptsIDao;

    @RequestMapping("getInspStatus")
    public String getEntbackupInspStatus(TReceiptsI receiptsI, ModelMap modelMap) {
        if(StringUtils.isEmpty(receiptsI.getReceiptNo()))
        {
            return "/receiptStatus/inspReceipt";
        }

        List<TReceiptsI> receiptsIList = receiptsIDao.queryAll(TableConstants.T_RECEIPTS_I, receiptsI," IN_TIME ASC");
        modelMap.put("receiptList", receiptsIList);

        return "/receiptStatus/inspReceipt";
    }
}
